<?php

class PublicAction extends Action {

    public function login() {
        $this->display();
    }
    public function test(){
        $arr = array();
        $arr1 = array(
                'url' => 'http://' . $_SERVER['HTTP_HOST'] . '/port/cookie_mgr.php',
                'key' => 'xxxxxxx',
         );
        array_push($arr,$arr1);
        $arr2 = array(
                'url' => 'http://' . $_SERVER['HTTP_HOST'] . '/port/cookie_mgr.php',
                'key' => 'yyyy',
         );
        array_push($arr,$arr2);
        dump($arr);
        
    }
        

    public function dologin() {
        $usr = $_POST['usr'];
        $psw = $_POST['psw'];
        header("Content-type: text/html;charset=utf-8");
        import('SSO/CnvpClientSSO');
        $loginInfo = CnvpClientSSO::loginSSO($usr, $psw, $alreadyEnc = false); 
        if ($loginInfo['status']>0) {
            //登陆成功
            $synLoginScript =CnvpClientSSO::getSynloginScript();
            //dump($loginInfo);
            dump($loginInfo);
            echo($synLoginScript);
            exit;
        }else
        {
            //登陆失败
        }
    }

}